package com.dongdongshop.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer;

@Configuration
public class MyFreemarkerConfig {

    @Bean
    public FreeMarkerConfigurer freeMarkerConfigurer(){
        FreeMarkerConfigurer fc = new FreeMarkerConfigurer();

        //第二步 :设置模板所在路劲
        fc.setTemplateLoaderPath("classpath:freemarker");

        //第三部 : 设置模板文件的字符集,一般是utf-8
        fc.setDefaultEncoding("UTF-8");

        return fc;
    }
}
